package com.main.organizationandplatformmanagement.domain.platform.service;

import com.main.common.base.resp.RespBody;
import com.main.organizationandplatformmanagement.application.service.PlatformService;
import com.main.organizationandplatformmanagement.domain.platform.entity.Platform;
import com.main.organizationandplatformmanagement.domain.platform.repository.PlatformRepository;
import com.main.organizationandplatformmanagement.interfaces.assembler.PlatformAssembler;
import com.main.organizationandplatformmanagement.interfaces.dto.PlatformDTO;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlatformServiceImpl implements PlatformService {
    @Resource
    private PlatformRepository platformRepository;
    public RespBody<List<PlatformDTO>> getPlatformList() {
        List<Platform> platformArr = platformRepository.list();
        List<PlatformDTO> platformDTOArr = new PlatformAssembler().toDTOs(platformArr);
        return RespBody.ok(platformDTOArr);
    }


}
